1. Field of the Invention
The present invention generally relates to performing calculations in a processor.
2. Description of the Related Art
Modern computer systems are typically capable of executing a wide variety of programs which perform various calculations at high speed. For example, a computer system may be configured to execute a video game in which a series of three-dimensional images (frames) is rapidly generated in a process referred to as rendering. The frames may then be displayed one after the other in quick succession, thereby producing an impression of motion. The video game may also be configured to perform physics simulations to simulate the result of actions being performed by a player of the video game.
Some of the computations performed during rendering may include mathematical functions that are not algebraic (such functions are commonly referred to as “transcendental functions”). For example, trigonometric, logarithm and exponentiation calculations may be performed during shading operations to determine an angle at which light from a light source reflects off of a surface. Transcendental calculations may also be performed where the video game performs physics simulations such as simulations of physical collisions between two objects. Such transcendental calculations may also be performed by other programs in addition to video games, such as rendering or graphics programs.
A common method for computing exponential and logarithmic functions in a computer system includes implementing floating point estimation algorithms. One method for floating point trigonometric estimation relies on software-based table lookup library functions, or hardware based table lookup functions. Software lookup methods involve having pre-generated Sine and Cosine table loaded into system memory. Since this method is software-based and the table is in memory, performance can be very slow when compared to other methods. A hardware-based solution may have table lookup logic circuitry in a simple programmable logic array (PLA) implementation or bipartite table implementation. These solutions for trigonometric functions are significantly faster than software based solutions, but consume substantial circuit area and may have performance disadvantages.
Accordingly, what is needed are an improved method, computer-readable medium, and apparatus for generating results of transcendental calculations in a manner that is more efficient relative to prior art approaches.